From: Robert Mader Date: Sat, 14 Sep 2019 17:24:36 +0000 (+0200) Subject: shell-util: Do not scale the clip in get_content_for_window_actor() X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~811^2^2~28 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=506b75fc7f3a1beeee6141ccb8edb6731c45cc6a;p=gnome-shell.git shell-util: Do not scale the clip in get_content_for_window_actor() This is now handled in Mutter. Also, respect the result size instead of assuming it to be equal to the clip size, as the clip takes actor coordinates while the result takes buffer coordinates. This can be fixed in a future API iteration. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/728 --- diff --git a/src/shell-util.c b/src/shell-util.c index 3f57ada8d..e94f3c364 100644 --- a/src/shell-util.c +++ b/src/shell-util.c @@ -429,28 +429,20 @@ shell_util_get_content_for_window_actor (MetaWindowActor *window_actor, cairo_surface_t *surface; cairo_rectangle_int_t clip; gfloat actor_x, actor_y; - gfloat resource_scale; clutter_actor_get_position (CLUTTER_ACTOR (window_actor), &actor_x, &actor_y); - if (!clutter_actor_get_resource_scale (CLUTTER_ACTOR (window_actor), - &resource_scale)) - { - resource_scale = 1.0; - g_warning ("Actor resource scale is not know at this point, " - "falling back to default 1.0"); - } - clip.x = window_rect->x - (gint) actor_x; clip.y = window_rect->y - (gint) actor_y; - clip.width = ceilf (window_rect->width * resource_scale); - clip.height = ceilf (window_rect->height * resource_scale); + clip.width = window_rect->width; + clip.height = window_rect->height; surface = meta_window_actor_get_image (window_actor, &clip); content = clutter_canvas_new (); clutter_canvas_set_size (CLUTTER_CANVAS (content), - clip.width, clip.height); + cairo_image_surface_get_width (surface), + cairo_image_surface_get_height (surface)); g_signal_connect (content, "draw", G_CALLBACK (canvas_draw_cb), surface); clutter_content_invalidate (content);